3.1.9 \(\int (c e+d e x) (a+b \text {ArcTan}(c+d x))^2 \, dx\) [9]

Optimal. Leaf size=95 \[ -a b e x-\frac {b^2 e (c+d x) \text {ArcTan}(c+d x)}{d}+\frac {e (a+b \text {ArcTan}(c+d x))^2}{2 d}+\frac {e (c+d x)^2 (a+b \text {ArcTan}(c+d x))^2}{2 d}+\frac {b^2 e \log \left (1+(c+d x)^2\right )}{2 d} \]

[Out]

-a*b*e*x-b^2*e*(d*x+c)*arctan(d*x+c)/d+1/2*e*(a+b*arctan(d*x+c))^2/d+1/2*e*(d*x+c)^2*(a+b*arctan(d*x+c))^2/d+1
/2*b^2*e*ln(1+(d*x+c)^2)/d

________________________________________________________________________________________

Rubi [A]
time = 0.09, antiderivative size = 95, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 7, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {5151, 12, 4946, 5036, 4930, 266, 5004} \begin {gather*} \frac {e (c+d x)^2 (a+b \text {ArcTan}(c+d x))^2}{2 d}+\frac {e (a+b \text {ArcTan}(c+d x))^2}{2 d}-a b e x-\frac {b^2 e (c+d x) \text {ArcTan}(c+d x)}{d}+\frac {b^2 e \log \left ((c+d x)^2+1\right )}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c*e + d*e*x)*(a + b*ArcTan[c + d*x])^2,x]

[Out]

-(a*b*e*x) - (b^2*e*(c + d*x)*ArcTan[c + d*x])/d + (e*(a + b*ArcTan[c + d*x])^2)/(2*d) + (e*(c + d*x)^2*(a + b
*ArcTan[c + d*x])^2)/(2*d) + (b^2*e*Log[1 + (c + d*x)^2])/(2*d)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 266

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 4930

Int[((a_.) + ArcTan[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*ArcTan[c*x^n])^p, x] - Dist[b*c
*n*p, Int[x^n*((a + b*ArcTan[c*x^n])^(p - 1)/(1 + c^2*x^(2*n))), x], x] /; FreeQ[{a, b, c, n}, x] && IGtQ[p, 0
] && (EqQ[n, 1] || EqQ[p, 1])

Rule 4946

Int[((a_.) + ArcTan[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)*((a + b*ArcTan[c*x^
n])^p/(m + 1)), x] - Dist[b*c*n*(p/(m + 1)), Int[x^(m + n)*((a + b*ArcTan[c*x^n])^(p - 1)/(1 + c^2*x^(2*n))),
x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0] && (EqQ[p, 1] || (EqQ[n, 1] && IntegerQ[m])) && NeQ[m, -1]

Rule 5004

Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)^2), x_Symbol] :> Simp[(a + b*ArcTan[c*x])^(p +
 1)/(b*c*d*(p + 1)), x] /; FreeQ[{a, b, c, d, e, p}, x] && EqQ[e, c^2*d] && NeQ[p, -1]

Rule 5036

Int[(((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_))/((d_) + (e_.)*(x_)^2), x_Symbol] :> Dist[f^2/
e, Int[(f*x)^(m - 2)*(a + b*ArcTan[c*x])^p, x], x] - Dist[d*(f^2/e), Int[(f*x)^(m - 2)*((a + b*ArcTan[c*x])^p/
(d + e*x^2)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && GtQ[p, 0] && GtQ[m, 1]

Rule 5151

Int[((a_.) + ArcTan[(c_) + (d_.)*(x_)]*(b_.))^(p_.)*((e_.) + (f_.)*(x_))^(m_.), x_Symbol] :> Dist[1/d, Subst[I
nt[(f*(x/d))^m*(a + b*ArcTan[x])^p, x], x, c + d*x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && EqQ[d*e - c*f, 0
] && IGtQ[p, 0]

Rubi steps

\begin {align*} \int (c e+d e x) \left (a+b \tan ^{-1}(c+d x)\right )^2 \, dx &=\frac {\text {Subst}\left (\int e x \left (a+b \tan ^{-1}(x)\right )^2 \, dx,x,c+d x\right )}{d}\\ &=\frac {e \text {Subst}\left (\int x \left (a+b \tan ^{-1}(x)\right )^2 \, dx,x,c+d x\right )}{d}\\ &=\frac {e (c+d x)^2 \left (a+b \tan ^{-1}(c+d x)\right )^2}{2 d}-\frac {(b e) \text {Subst}\left (\int \frac {x^2 \left (a+b \tan ^{-1}(x)\right )}{1+x^2} \, dx,x,c+d x\right )}{d}\\ &=\frac {e (c+d x)^2 \left (a+b \tan ^{-1}(c+d x)\right )^2}{2 d}-\frac {(b e) \text {Subst}\left (\int \left (a+b \tan ^{-1}(x)\right ) \, dx,x,c+d x\right )}{d}+\frac {(b e) \text {Subst}\left (\int \frac {a+b \tan ^{-1}(x)}{1+x^2} \, dx,x,c+d x\right )}{d}\\ &=-a b e x+\frac {e \left (a+b \tan ^{-1}(c+d x)\right )^2}{2 d}+\frac {e (c+d x)^2 \left (a+b \tan ^{-1}(c+d x)\right )^2}{2 d}-\frac {\left (b^2 e\right ) \text {Subst}\left (\int \tan ^{-1}(x) \, dx,x,c+d x\right )}{d}\\ &=-a b e x-\frac {b^2 e (c+d x) \tan ^{-1}(c+d x)}{d}+\frac {e \left (a+b \tan ^{-1}(c+d x)\right )^2}{2 d}+\frac {e (c+d x)^2 \left (a+b \tan ^{-1}(c+d x)\right )^2}{2 d}+\frac {\left (b^2 e\right ) \text {Subst}\left (\int \frac {x}{1+x^2} \, dx,x,c+d x\right )}{d}\\ &=-a b e x-\frac {b^2 e (c+d x) \tan ^{-1}(c+d x)}{d}+\frac {e \left (a+b \tan ^{-1}(c+d x)\right )^2}{2 d}+\frac {e (c+d x)^2 \left (a+b \tan ^{-1}(c+d x)\right )^2}{2 d}+\frac {b^2 e \log \left (1+(c+d x)^2\right )}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 107, normalized size = 1.13 \begin {gather*} \frac {e \left (a (c+d x) (-2 b+a c+a d x)+2 b \left (-b (c+d x)+a \left (1+c^2+2 c d x+d^2 x^2\right )\right ) \text {ArcTan}(c+d x)+b^2 \left (1+c^2+2 c d x+d^2 x^2\right ) \text {ArcTan}(c+d x)^2+b^2 \log \left (1+(c+d x)^2\right )\right )}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c*e + d*e*x)*(a + b*ArcTan[c + d*x])^2,x]

[Out]

(e*(a*(c + d*x)*(-2*b + a*c + a*d*x) + 2*b*(-(b*(c + d*x)) + a*(1 + c^2 + 2*c*d*x + d^2*x^2))*ArcTan[c + d*x]
+ b^2*(1 + c^2 + 2*c*d*x + d^2*x^2)*ArcTan[c + d*x]^2 + b^2*Log[1 + (c + d*x)^2]))/(2*d)

________________________________________________________________________________________

Maple [A]
time = 0.16, size = 124, normalized size = 1.31

method result size
derivativedivides \(\frac {\frac {e \left (d x +c \right )^{2} a^{2}}{2}+\frac {e \,b^{2} \left (d x +c \right )^{2} \arctan \left (d x +c \right )^{2}}{2}+\frac {e \,b^{2} \arctan \left (d x +c \right )^{2}}{2}-e \,b^{2} \arctan \left (d x +c \right ) \left (d x +c \right )+\frac {e \,b^{2} \ln \left (1+\left (d x +c \right )^{2}\right )}{2}+e a b \left (d x +c \right )^{2} \arctan \left (d x +c \right )+e a b \arctan \left (d x +c \right )-e \left (d x +c \right ) a b}{d}\) \(124\)
default \(\frac {\frac {e \left (d x +c \right )^{2} a^{2}}{2}+\frac {e \,b^{2} \left (d x +c \right )^{2} \arctan \left (d x +c \right )^{2}}{2}+\frac {e \,b^{2} \arctan \left (d x +c \right )^{2}}{2}-e \,b^{2} \arctan \left (d x +c \right ) \left (d x +c \right )+\frac {e \,b^{2} \ln \left (1+\left (d x +c \right )^{2}\right )}{2}+e a b \left (d x +c \right )^{2} \arctan \left (d x +c \right )+e a b \arctan \left (d x +c \right )-e \left (d x +c \right ) a b}{d}\) \(124\)
risch \(-\frac {e \,b^{2} \left (d^{2} x^{2}+2 c d x +c^{2}+1\right ) \ln \left (1+i \left (d x +c \right )\right )^{2}}{8 d}+\frac {b e \left (-2 i a \,d^{2} x^{2}+b \,d^{2} x^{2} \ln \left (1-i \left (d x +c \right )\right )-4 i a c x d +2 b c d x \ln \left (1-i \left (d x +c \right )\right )+2 i b d x +\ln \left (1-i \left (d x +c \right )\right ) b \,c^{2}+b \ln \left (1-i \left (d x +c \right )\right )\right ) \ln \left (1+i \left (d x +c \right )\right )}{4 d}-\frac {e d \,b^{2} x^{2} \ln \left (1-i \left (d x +c \right )\right )^{2}}{8}+\frac {i e d a b \,x^{2} \ln \left (1-i \left (d x +c \right )\right )}{2}-\frac {e \,b^{2} c x \ln \left (1-i \left (d x +c \right )\right )^{2}}{4}+i e a b c x \ln \left (1-i \left (d x +c \right )\right )-\frac {e \,b^{2} c^{2} \ln \left (1-i \left (d x +c \right )\right )^{2}}{8 d}-\frac {i e \,b^{2} x \ln \left (1-i \left (d x +c \right )\right )}{2}+\frac {e \,a^{2} d \,x^{2}}{2}+\frac {e a b \,c^{2} \arctan \left (d x +c \right )}{d}+e \,a^{2} c x -\frac {e \,b^{2} \ln \left (1-i \left (d x +c \right )\right )^{2}}{8 d}-\frac {e \,b^{2} c \arctan \left (d x +c \right )}{d}-a b e x +\frac {e a b \arctan \left (d x +c \right )}{d}+\frac {e \,b^{2} \ln \left (d^{2} x^{2}+2 c d x +c^{2}+1\right )}{2 d}\) \(393\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*e*x+c*e)*(a+b*arctan(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(1/2*e*(d*x+c)^2*a^2+1/2*e*b^2*(d*x+c)^2*arctan(d*x+c)^2+1/2*e*b^2*arctan(d*x+c)^2-e*b^2*arctan(d*x+c)*(d*
x+c)+1/2*e*b^2*ln(1+(d*x+c)^2)+e*a*b*(d*x+c)^2*arctan(d*x+c)+e*a*b*arctan(d*x+c)-e*(d*x+c)*a*b)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 229 vs. \(2 (94) = 188\).
time = 1.15, size = 229, normalized size = 2.41 \begin {gather*} \frac {1}{2} \, a^{2} d x^{2} e + {\left (x^{2} \arctan \left (d x + c\right ) - d {\left (\frac {x}{d^{2}} + \frac {{\left (c^{2} - 1\right )} \arctan \left (\frac {d^{2} x + c d}{d}\right )}{d^{3}} - \frac {c \log \left (d^{2} x^{2} + 2 \, c d x + c^{2} + 1\right )}{d^{3}}\right )}\right )} a b d e + a^{2} c x e + \frac {{\left (2 \, {\left (d x + c\right )} \arctan \left (d x + c\right ) - \log \left ({\left (d x + c\right )}^{2} + 1\right )\right )} a b c e}{d} + \frac {b^{2} e \log \left (d^{2} x^{2} + 2 \, c d x + c^{2} + 1\right ) + {\left (b^{2} d^{2} x^{2} e + 2 \, b^{2} c d x e + b^{2} c^{2} e + b^{2} e\right )} \arctan \left (d x + c\right )^{2} - 2 \, {\left (b^{2} d x e + b^{2} c e\right )} \arctan \left (d x + c\right )}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*e*x+c*e)*(a+b*arctan(d*x+c))^2,x, algorithm="maxima")

[Out]

1/2*a^2*d*x^2*e + (x^2*arctan(d*x + c) - d*(x/d^2 + (c^2 - 1)*arctan((d^2*x + c*d)/d)/d^3 - c*log(d^2*x^2 + 2*
c*d*x + c^2 + 1)/d^3))*a*b*d*e + a^2*c*x*e + (2*(d*x + c)*arctan(d*x + c) - log((d*x + c)^2 + 1))*a*b*c*e/d +
1/2*(b^2*e*log(d^2*x^2 + 2*c*d*x + c^2 + 1) + (b^2*d^2*x^2*e + 2*b^2*c*d*x*e + b^2*c^2*e + b^2*e)*arctan(d*x +
 c)^2 - 2*(b^2*d*x*e + b^2*c*e)*arctan(d*x + c))/d

________________________________________________________________________________________

Fricas [A]
time = 3.95, size = 147, normalized size = 1.55 \begin {gather*} \frac {{\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2} + b^{2}\right )} \arctan \left (d x + c\right )^{2} e + b^{2} e \log \left (d^{2} x^{2} + 2 \, c d x + c^{2} + 1\right ) + 2 \, {\left (a b d^{2} x^{2} + a b c^{2} - b^{2} c + {\left (2 \, a b c - b^{2}\right )} d x + a b\right )} \arctan \left (d x + c\right ) e + {\left (a^{2} d^{2} x^{2} + 2 \, {\left (a^{2} c - a b\right )} d x\right )} e}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*e*x+c*e)*(a+b*arctan(d*x+c))^2,x, algorithm="fricas")

[Out]

1/2*((b^2*d^2*x^2 + 2*b^2*c*d*x + b^2*c^2 + b^2)*arctan(d*x + c)^2*e + b^2*e*log(d^2*x^2 + 2*c*d*x + c^2 + 1)
+ 2*(a*b*d^2*x^2 + a*b*c^2 - b^2*c + (2*a*b*c - b^2)*d*x + a*b)*arctan(d*x + c)*e + (a^2*d^2*x^2 + 2*(a^2*c -
a*b)*d*x)*e)/d

________________________________________________________________________________________

Sympy [C] Result contains complex when optimal does not.
time = 1.38, size = 240, normalized size = 2.53 \begin {gather*} \begin {cases} a^{2} c e x + \frac {a^{2} d e x^{2}}{2} + \frac {a b c^{2} e \operatorname {atan}{\left (c + d x \right )}}{d} + 2 a b c e x \operatorname {atan}{\left (c + d x \right )} + a b d e x^{2} \operatorname {atan}{\left (c + d x \right )} - a b e x + \frac {a b e \operatorname {atan}{\left (c + d x \right )}}{d} + \frac {b^{2} c^{2} e \operatorname {atan}^{2}{\left (c + d x \right )}}{2 d} + b^{2} c e x \operatorname {atan}^{2}{\left (c + d x \right )} - \frac {b^{2} c e \operatorname {atan}{\left (c + d x \right )}}{d} + \frac {b^{2} d e x^{2} \operatorname {atan}^{2}{\left (c + d x \right )}}{2} - b^{2} e x \operatorname {atan}{\left (c + d x \right )} + \frac {b^{2} e \log {\left (\frac {c}{d} + x - \frac {i}{d} \right )}}{d} + \frac {b^{2} e \operatorname {atan}^{2}{\left (c + d x \right )}}{2 d} - \frac {i b^{2} e \operatorname {atan}{\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\c e x \left (a + b \operatorname {atan}{\left (c \right )}\right )^{2} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*e*x+c*e)*(a+b*atan(d*x+c))**2,x)

[Out]

Piecewise((a**2*c*e*x + a**2*d*e*x**2/2 + a*b*c**2*e*atan(c + d*x)/d + 2*a*b*c*e*x*atan(c + d*x) + a*b*d*e*x**
2*atan(c + d*x) - a*b*e*x + a*b*e*atan(c + d*x)/d + b**2*c**2*e*atan(c + d*x)**2/(2*d) + b**2*c*e*x*atan(c + d
*x)**2 - b**2*c*e*atan(c + d*x)/d + b**2*d*e*x**2*atan(c + d*x)**2/2 - b**2*e*x*atan(c + d*x) + b**2*e*log(c/d
 + x - I/d)/d + b**2*e*atan(c + d*x)**2/(2*d) - I*b**2*e*atan(c + d*x)/d, Ne(d, 0)), (c*e*x*(a + b*atan(c))**2
, True))

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*e*x+c*e)*(a+b*arctan(d*x+c))^2,x, algorithm="giac")

[Out]

sage0*x

________________________________________________________________________________________

Mupad [B]
time = 1.61, size = 216, normalized size = 2.27 \begin {gather*} {\mathrm {atan}\left (c+d\,x\right )}^2\,\left (\frac {e\,b^2\,c^2+e\,b^2}{2\,d}+b^2\,c\,e\,x+\frac {b^2\,d\,e\,x^2}{2}\right )-x\,\left (a\,e\,\left (b-3\,a\,c\right )+2\,a^2\,c\,e\right )-d^2\,\mathrm {atan}\left (c+d\,x\right )\,\left (\frac {x\,\left (b^2\,e-2\,a\,b\,c\,e\right )}{d^2}-\frac {a\,b\,e\,x^2}{d}\right )+\frac {b^2\,e\,\ln \left (c^2+2\,c\,d\,x+d^2\,x^2+1\right )}{2\,d}+\frac {a^2\,d\,e\,x^2}{2}+\frac {b\,e\,\mathrm {atan}\left (\frac {b\,c\,e\,\left (a\,c^2-b\,c+a\right )+b\,d\,e\,x\,\left (a\,c^2-b\,c+a\right )}{-e\,b^2\,c+a\,e\,b\,c^2+a\,e\,b}\right )\,\left (a\,c^2-b\,c+a\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c*e + d*e*x)*(a + b*atan(c + d*x))^2,x)

[Out]

atan(c + d*x)^2*((b^2*e + b^2*c^2*e)/(2*d) + b^2*c*e*x + (b^2*d*e*x^2)/2) - x*(a*e*(b - 3*a*c) + 2*a^2*c*e) -
d^2*atan(c + d*x)*((x*(b^2*e - 2*a*b*c*e))/d^2 - (a*b*e*x^2)/d) + (b^2*e*log(c^2 + d^2*x^2 + 2*c*d*x + 1))/(2*
d) + (a^2*d*e*x^2)/2 + (b*e*atan((b*c*e*(a - b*c + a*c^2) + b*d*e*x*(a - b*c + a*c^2))/(a*b*e - b^2*c*e + a*b*
c^2*e))*(a - b*c + a*c^2))/d

________________________________________________________________________________________